package com.nofeng.wx.luna;

import com.nlf.calendar.EightChar;
import com.nlf.calendar.Lunar;
import com.nlf.calendar.Solar;
import com.nofeng.wx.luna.model.MyLuna;

public class MyLunaApplication {

    public static void execute(MyLuna myLuna){
        Solar solar =init(myLuna);
        Lunar lunar = solar.getLunar();
        EightChar eightChar = lunar.getEightChar();


    }

    private static Solar init(MyLuna myLuna) {
        String dayStr = myLuna.getBirthday();
        Integer yearInt = Integer.valueOf(dayStr.substring(0, 4));
        Integer monthInt = Integer.valueOf(dayStr.substring(4, 6));
        Integer dayInt = Integer.valueOf(dayStr.substring(6, 8));
        Integer hourInt = Integer.valueOf(dayStr.substring(8, 10));
        Integer minuteInt = Integer.valueOf(dayStr.substring(10, 12));
        myLuna.setYear(yearInt);
        myLuna.setMonth(monthInt);
        myLuna.setDay(dayInt);
        myLuna.setHour(hourInt);
        myLuna.setMinute(minuteInt);
        Solar solar = new Solar(yearInt, monthInt, dayInt, hourInt, minuteInt, 0);
        return solar;
    }


}
